package com.luom.fsp.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.luom.fsp.model.dto.productSKU.ProductSKUQueryRequest;
import com.luom.fsp.model.entity.ProductSKU;
import com.luom.fsp.model.vo.ProductSKUVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 商品规格服务
 *
*/
public interface ProductSKUService extends IService<ProductSKU> {

    /**
     * 校验数据
     *
     * @param productSKU
     * @param add 对创建的数据进行校验
     */
    void validProductSKU(ProductSKU productSKU, boolean add);

    /**
     * 获取查询条件
     *
     * @param productSKUQueryRequest
     * @return
     */
    QueryWrapper<ProductSKU> getQueryWrapper(ProductSKUQueryRequest productSKUQueryRequest);
    
    /**
     * 获取商品规格封装
     *
     * @param productSKU
     * @param request
     * @return
     */
    ProductSKUVO getProductSKUVO(ProductSKU productSKU, HttpServletRequest request);

    /**
     * 分页获取商品规格封装
     *
     * @param productSKUPage
     * @param request
     * @return
     */
    Page<ProductSKUVO> getProductSKUVOPage(Page<ProductSKU> productSKUPage, HttpServletRequest request);
}
